import Vue from "vue"
import VeeValidate, { Validator } from "vee-validate"
Vue.use(VeeValidate)

const dictionary = {
    messages: {
        phone: (field) => field,
    },
    attributes: {
        phone: "输入手机号码"
    }
}

Validator.updateDictionary(dictionary)

Validator.extend("phone", {
    messages: {
        phone: (field) => "手机号格式不正确"
    },
    validate: value => /^1[2-9]\d{9}$/.test(value)
})